
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace ScrewTurn.Wiki.PluginFramework {
	
	/// <summary>
	/// Defines extended methods for USers Storage Providers.
	/// </summary>
	public interface IExtendedUsersStorageProvider : IUsersStorageProvider {

		/// <summary>
		/// Tries to login a user directly through the provider.
		/// </summary>
		/// <param name="username">The username.</param>
		/// <param name="password">The password.</param>
		/// <returns>The correct UserInfo object, or <b>null</b>.</returns>
		UserInfo TryManualLogin(string username, string password);

		/// <summary>
		/// Tries to login a user directly through the provider using 
		/// the current HttpContext and without username/password.
		/// </summary>
		/// <param name="context">The current HttpContext.</param>
		/// <returns>The correct UserInfo object, or <b>null</b>.</returns>
		UserInfo TryAutoLogin(HttpContext context);

		/// <summary>
		/// Tries to retrieve the information about a user account.
		/// </summary>
		/// <param name="username">The username.</param>
		/// <returns>The correct UserInfo object, or <b>null</b>.</returns>
		UserInfo TryGetUser(string username);

		/// <summary>
		/// Notifies to the provider that a user has logged out.
		/// </summary>
		/// <param name="user">The user who has logged out.</param>
		void NotifyLogout(UserInfo user);

	}

}
